All Questions
18 questions
0votes
0answers
251views
better structure of a software project to prevent circular dependencies
I am contacting you today regarding a recent problem with circular dependencies. It's about a Spring boot application that accepts data via a Rest API and then forwards it to an internal Spring ...
0votes
0answers
205views
How to handle dependency injection in a library to avoid frequent breaking changes?
Let's say I have a C# .NET library with the following classes: public class FooService { private readonly IDependencyA a; public FooService(IDependencyA a) { this.a = a; } ...
1vote
2answers
205views
Why do we separate interface when implementing interface injection variant of DI?
With interface injection (wikpedia) we have a method to set the dependency on the client as part of an interfase. public interface ServiceSetter { public void setService(Service service); } Why ...
0votes
3answers
662views
Java Library - How to do Pure Dependency Injection When State is a Factor?
To set the stage, I am trying to do pure dependency injection for a Java Library I am creating to make it more testable. As it is a library, I want to do pure dependency injection without creating a ...
0votes
0answers
108views
How to design for optional dependency / optional functionality
Let's say for a Net Core library that I will deliver to the customer The library define a Interface like IGetData and also a default GetData class. The library also define a ICacher interface with a ...
8votes
6answers
2kviews
I need help solving a common architectural problem with multiple concrete classes implementing an interface
I have a common issue I encounter which I've solved with a Factory class in the past but it always felt a little "off". Let's say I have multiple Exporter classes which implement IExporter, which has ...
2votes
4answers
188views
Make a class depends on its own ports instead of injecting dependency interfaces
I just have an idea about dependency management in Spring IOC environment that seems to be better than the typical approach, but I am not sure because I can't find any references or example out there ...
49votes
3answers
9kviews
Using a "Pass-through (God) Service" is bad, right? [duplicate]
My team has developed a new service layer in our application. They created a bunch of services that implement their interfaces (E.g., ICustomerService, IUserService, etc). That's pretty good so far. ...
0votes
2answers
532views
Design issue with delegation, inheritance and dependency injection
My question relates to usage of delegation together with inheritance and dependency injection. I have a MailerService class that requires a delegate in order to do its job. Furthermore, I have a ...
3votes
4answers
685views
Circular Interface references
I've heard circular references are generally an issue, however I was wondering if this was true for interfaces that reference other interfaces, for example: IQuestion{ IAnswer getCorrectAnswer(); ...
1vote
1answer
336views
Passing ServiceLayer's services to WCF service
I want to expose my business logic via WCF service in the intranet environment. I have N-tier architecture, pretty simple: Database -> .Data (DAL) -> .Business (Service Layer) -> WCF So, far I have ...
2votes
1answer
259views
How to add extra functionality to an existing method class dynamically with DI?
I am looking for the best pattern to apply in my problem. I have an interface that defines my service class functionality interface NegotiationInterface { abstract public function ...
1vote
1answer
2kviews
Service locator vs Dependency Injection?
I have a class which acts as a Adaptor between an HTTP request and our Application's custom domain request. So every Http request element: URI, headers, content are mapped to our customized domain ...
4votes
1answer
253views
Does an IoC Container affect the design of an application using Dependency Injection?
Is it safe to say that a Container is the "program" or mechanism that manages IoC via DI, but it doesn't really change your initial design of DI to accomplish loose coupling? In other words, if I ...
3votes
0answers
579views
Mocking third party web service
I am working on a project to create a wrapper library which will be used to interact with a web service provided by the client's IT team. The reason for this library is that we interact with this ...